<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>QQListener: D:/MyProgramme/VC++/QQListener/QQListener.cpp文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- 制作者 Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>首页</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>文件成员</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>D:/MyProgramme/VC++/QQListener/QQListener.cpp文件参考</h1>QQListener的代码文件.  
<a href="#_details">更多...</a>
<p>
<code>#include &lt;stdio.h&gt;</code><br>
<code>#include &lt;pcap.h&gt;</code><br>
<code>#include &quot;<a class="el" href="_q_q_listener_8h_source.html">QQListener.h</a>&quot;</code><br>
<code>#include &lt;windows.h&gt;</code><br>
<code>#include &lt;Iphlpapi.h&gt;</code><br>
<code>#include &quot;<a class="el" href="lanlist_8h_source.html">lanlist.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="arp_8h_source.html">arp.h</a>&quot;</code><br>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>函数</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_q_q_listener_8cpp.html#124b294ff237795262ca4962bdbf090f">init_device</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">函数首先枚举所有网卡,并列出,让用户选择 然后打开网卡,保存指针  <a href="#124b294ff237795262ca4962bdbf090f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e66f6b31b5ad750f1fe042a706a4e3d4"></a><!-- doxytag: member="QQListener.cpp::main" ref="e66f6b31b5ad750f1fe042a706a4e3d4" args="()" -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><b>main</b> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">BOOL WINAPI&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_q_q_listener_8cpp.html#222e0ef6abfe7ef337d2d0ea71d5300d">HandlerRoutine</a> (DWORD dwCtrlType)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">这个退出时调用的函数,我们在这里完成的工作是扫尾  <a href="#222e0ef6abfe7ef337d2d0ea71d5300d"></a><br></td></tr>
<tr><td colspan="2"><br><h2>变量</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9ae2f666b227f61a0fe7e6dbb7fcfc52"></a><!-- doxytag: member="QQListener.cpp::ca" ref="9ae2f666b227f61a0fe7e6dbb7fcfc52" args="" -->
CRITICAL_SECTION&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_q_q_listener_8cpp.html#9ae2f666b227f61a0fe7e6dbb7fcfc52">ca</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">临界区变量用于线程同步的 <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="65fde8b8db5a33ec05f7e109e54a1060"></a><!-- doxytag: member="QQListener.cpp::g_ip_list" ref="65fde8b8db5a33ec05f7e109e54a1060" args="" -->
PIP_LIST&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_q_q_listener_8cpp.html#65fde8b8db5a33ec05f7e109e54a1060">g_ip_list</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">保存ip地址等信息的链表 <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2cc064a825357f79c319bf50217c89dc"></a><!-- doxytag: member="QQListener.cpp::g_thread_listen" ref="2cc064a825357f79c319bf50217c89dc" args="" -->
HANDLE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_q_q_listener_8cpp.html#2cc064a825357f79c319bf50217c89dc">g_thread_listen</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">监听线程的句柄 <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="efdaab6a333a140dbf0b5ba4a996f0af"></a><!-- doxytag: member="QQListener.cpp::g_p_dev_handle" ref="efdaab6a333a140dbf0b5ba4a996f0af" args="" -->
pcap_t *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_q_q_listener_8cpp.html#efdaab6a333a140dbf0b5ba4a996f0af">g_p_dev_handle</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">用来保存用户所选并且已经打开的设备的指针 <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4e97737122abbd58fe40e038d1ef1153"></a><!-- doxytag: member="QQListener.cpp::g_bt_local_mac" ref="4e97737122abbd58fe40e038d1ef1153" args="[6]" -->
BYTE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_q_q_listener_8cpp.html#4e97737122abbd58fe40e038d1ef1153">g_bt_local_mac</a> [6] = {0}</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">本机mac <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a8803747be9a78c0f5b603f2deb0b53a"></a><!-- doxytag: member="QQListener.cpp::g_bt_gateway_mac" ref="a8803747be9a78c0f5b603f2deb0b53a" args="[6]" -->
BYTE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_q_q_listener_8cpp.html#a8803747be9a78c0f5b603f2deb0b53a">g_bt_gateway_mac</a> [6] = {0}</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">网关mac <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7f184643741eeb122b1841c807c5e09e"></a><!-- doxytag: member="QQListener.cpp::g_sz_gateway_ip" ref="7f184643741eeb122b1841c807c5e09e" args="[18]" -->
char&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_q_q_listener_8cpp.html#7f184643741eeb122b1841c807c5e09e">g_sz_gateway_ip</a> [18] = {0}</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">网关IP <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b07d11207a92ea0d1626324cde88983d"></a><!-- doxytag: member="QQListener.cpp::g_sz_local_ip" ref="b07d11207a92ea0d1626324cde88983d" args="[18]" -->
char&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_q_q_listener_8cpp.html#b07d11207a92ea0d1626324cde88983d">g_sz_local_ip</a> [18] = {0}</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">网关IP <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5edde6e91735c2dc56ed2a48cb8d9ba2"></a><!-- doxytag: member="QQListener.cpp::g_arp_recover" ref="5edde6e91735c2dc56ed2a48cb8d9ba2" args="" -->
ARP_PACKET&nbsp;</td><td class="memItemRight" valign="bottom"><b>g_arp_recover</b></td></tr>

</table>
<hr><h2>详细描述</h2>
QQListener的代码文件. 
<p>
<hr><h2>函数文档</h2>
<a class="anchor" name="222e0ef6abfe7ef337d2d0ea71d5300d"></a><!-- doxytag: member="QQListener.cpp::HandlerRoutine" ref="222e0ef6abfe7ef337d2d0ea71d5300d" args="(DWORD dwCtrlType)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL WINAPI HandlerRoutine           </td>
          <td>(</td>
          <td class="paramtype">DWORD&nbsp;</td>
          <td class="paramname"> <em>dwCtrlType</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
这个退出时调用的函数,我们在这里完成的工作是扫尾 
<p>
<dl compact><dt><b>参数:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dwCtrlType</em>&nbsp;</td><td>见msdn </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>返回:</b></dt><dd>见msdn </dd></dl>

</div>
</div><p>
<a class="anchor" name="124b294ff237795262ca4962bdbf090f"></a><!-- doxytag: member="QQListener.cpp::init_device" ref="124b294ff237795262ca4962bdbf090f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool init_device           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
函数首先枚举所有网卡,并列出,让用户选择 然后打开网卡,保存指针 
<p>
<dl class="return" compact><dt><b>返回:</b></dt><dd>如果没有错误返回true,否则返回false </dd></dl>

</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated at Wed Oct 7 12:50:14 2009 for QQListener by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>
